import type { UserInfo } from '@/types/api'

export const useUserInfoStore = defineStore(
  'userInfo',
  () => {
    const userInfo = ref<UserInfo>()

    const setUserInfo = (newVal?: UserInfo) => {
      userInfo.value = newVal
    }

    const $reset = () => setUserInfo()

    return { userInfo, setUserInfo, $reset }
  },
  {
    persist: true,
  },
)
